import Vue from 'vue'
import Vuex from 'vuex'
import menus from './modules/menus' //菜单模块
import user from './modules/userInfo' //用户信息模块

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        //登录携带token
        token: ''
    },
    mutations: {
        //设置token
        SET_TOKEN: (state, token) => {
            state.token = token
            localStorage.setItem("token", token)
        },
    },
    actions: {},
    //声明引入的模块
    modules: {
        menus,
        user
    }
})